//
//  PictureTableViewCell.m
//  littleLight's Project-A
//
//  Created by dllo on 16/5/28.
//  Copyright © 2016年 light. All rights reserved.
//

#import "PictureTableViewCell.h"
#import <UIImageView+WebCache.h>

@implementation PictureTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
        
    }
    return self;
    
}


- (void)createView
{
    self.imageV = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imageV];
    
    self.textL = [[UILabel alloc] init];
    self.textL.numberOfLines = 0;
    self.textL.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.textL];
    
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageV.frame = CGRectMake(0, 0, self.contentView.frame.size.width, 250);
    
    self.textL.frame = CGRectMake(5 , 280, self.contentView.frame.size.width - 10, 0);
    
    [self.textL sizeToFit];
    

}


- (void)setModel:(PictureModel *)model
{
    _model = model;
    
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:_model.photo_webtrip]];
    self.textL.text = _model.text;
    
    
    
    
}


@end
